<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateYsArticleTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('article', function(Blueprint $table)
		{
			$table->increments('id')->comment('主键id');
			$table->string('book_num', 32)->nullable()->index()->comment('关联书籍编号');
			$table->string('chapter_num', 32)->index()->comment('关联章节编号');
			$table->text('article')->comment('本章内容');
			$table->integer('create_time')->comment('创建时间');
			$table->integer('last_editdate')->nullable()->comment('最后一次编辑时间');
			$table->boolean('status')->default(1)->comment('是否已发布,1为已发布2为已删除3为审核中');
			$table->boolean('share')->nullable()->default(0)->comment('是否分享1为分享');
			$table->integer('word_count')->nullable()->default(0)->comment('更新字数');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('article');
	}

}
